package com.fan.txl.data.contact;

import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.os.Parcel;
import android.os.Parcelable;

import com.fan.txl.BR;

/**
 * Created by os on 2017/5/2.
 * Title
 */

public class Contact extends BaseObservable implements Parcelable {
    private String mobile="151xxxx0907";
    private String name="选择朋友";

    public Contact() {
    }

    public Contact(String mobile, String name) {
        this.mobile = mobile;
        this.name = name;
    }
    @Bindable
    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
        notifyPropertyChanged(BR.mobile);
    }
    @Bindable
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        notifyPropertyChanged(BR.name);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.mobile);
        dest.writeString(this.name);
    }

    protected Contact(Parcel in) {
        this.mobile = in.readString();
        this.name = in.readString();
    }

    public static final Parcelable.Creator<Contact> CREATOR = new Parcelable.Creator<Contact>() {
        @Override
        public Contact createFromParcel(Parcel source) {
            return new Contact(source);
        }

        @Override
        public Contact[] newArray(int size) {
            return new Contact[size];
        }
    };
}
